#!/bin/sh
#
# cmus song script
#
## Check if cmus is working
if [ -n "$(pgrep -x cmus)" ]; then

	## if song has title metadata then use it else show file name
	[ -n "$(cmus-remote -Q | sed -ne 's/^.*title //p')" ] \
		&& OUTPUT="$(cmus-remote -Q | sed -ne 's/tag\ artist\ //p') - $(cmus-remote -Q | sed -ne 's/^.*title //p')" \
		|| OUTPUT="$(cmus-remote -Q | sed -ne 's/^.*\///p')"
	
	printf "\\uf025 %s" "$OUTPUT"
else
	echo -e "\\uf025 "
fi
